<?php
class admin extends AppBase {
	function _construct(){
		$rel_path = $this->path_rel;
		$path = $this->path;
		$this->add_resource('html','main.php','','start');
		$this->add_resource('css','app.css','','start');
		// MD5 helps make sure the browser loads the new js file if it has changed
		$js = 'app.js';
		$md5 = md5_file($path . '/' . $js);
		$this->add_resource('js',$js . '?md5=' . $md5,'','start');
	}
	function app_load(){
		$this->wappLog($this->class . ' app_load');
		# Called when app instance is first created
	}
	function app_poll($has_focus){
		$this->wappLog($this->class . ' app_poll');
		# Called everytime the app is polled
		if ($has_focus){
//			$fs = new fs();
//			$str = str_replace('\\','\\\\',$fs->tmp_dir);
//			//$str = 'hello';
//			$this->wapi->text('div#home',$str);
		}
		echo $this->class . ' ' . date("Y-m-d H:i:s",time()) . "<br />\n";
		return false;
		// if app_poll returns true, the app instance will be saved;
		// otherwise the app will be unloaded
	}
	function app_unload(){
		$this->wappLog($this->class . ' app_unload');
		# Called only when the app is being unloaded
	}
	function _destruct(){

	}
	function com_echo_it(){
		echo "echoed";

	}
}
?>